<div class="ibox">
    <div class="ibox-title">
        <h5>
            <vc:i18n name="添加地磁" namespace="addParkingSpaceMachine"></vc:i18n>
        </h5>
        <div class="ibox-tools" style="top:10px;">
        </div>
    </div>
    <div class="ibox-content">
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name='设备名称' namespace='addParkingSpaceMachine'></vc:i18n>
            </label>
            <div class="col-sm-4">
                <input v-model="addParkingSpaceMachineInfo.machineName" type="text"
                    :placeholder="vc.i18n('必填，请填写设备名称','addParkingSpaceMachine')" class="form-control">
            </div>
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name='设备编码' namespace='addParkingSpaceMachine'></vc:i18n>
            </label>
            <div class="col-sm-4">
                <input v-model="addParkingSpaceMachineInfo.machineCode" type="text"
                    :placeholder="vc.i18n('必填，请填写设备编码','addParkingSpaceMachine')" class="form-control">
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name='设备IP' namespace='addParkingSpaceMachine'></vc:i18n>
            </label>
            <div class="col-sm-4">
                <input v-model="addParkingSpaceMachineInfo.machineIp" type="text"
                    :placeholder="vc.i18n('选填，请填写设备IP','addParkingSpaceMachine')" class="form-control">
            </div>
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name='设备mac' namespace='addParkingSpaceMachine'></vc:i18n>
            </label>
            <div class="col-sm-4">
                <input v-model="addParkingSpaceMachineInfo.machineMac" type="text"
                    :placeholder="vc.i18n('选填，请填写设备mac','addParkingSpaceMachine')" class="form-control">
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name='工牌厂家' namespace='addParkingSpaceMachine'></vc:i18n>
            </label>
            <div class="col-sm-4">
                <select class="custom-select" v-model="addParkingSpaceMachineInfo.implBean">
                    <option selected disabled value="">
                        {{vc.i18n('必填，请选择工牌厂家','addParkingSpaceMachine')}}
                    </option>
                    <option :value="item.factoryId" v-for="(item,index) in addParkingSpaceMachineInfo.factorys">
                        {{item.factoryName}}</option>
                </select>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label text-right">
                <vc:i18n name='绑定车位' namespace='addParkingSpaceMachine'></vc:i18n>
            </label>
            <div class="col-sm-10 flex justify-start">
                <div class="margin-right" v-for="(item,index) in addParkingSpaceMachineInfo.parkingSpaces" :key="index">{{item.psName}} <span class="fa fa-remove hand" @click="_deleteParkingSpace(item)" style="color: #dc3545;"></span></div>
                <div class="margin-left">
                    <button type="button" class="btn btn-primary btn-sm" @click="openSearchParkingSpaceModel()">选择车位
                    </button>
                </div>
            </div>
        </div>
        <div class="ibox-content">
            <button class="btn btn-primary float-right" type="button" @click="_saveParkingSpaceMachine()">
                <vc:i18n name="保存"></vc:i18n>
            </button>
            <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" @click="vc.goBack()">
                <vc:i18n name="取消"></vc:i18n>
            </button>
        </div>
    </div>

    <vc:create path="car/searchParkingSpace" emitChooseParkingSpace="addParkingSpaceMachine"
        emitLoadData="addParkingSpaceMachine" parkingSpaceFlag="" showSearchCondition="true">
    </vc:create>
</div>